package com.loe.test.chart

import android.graphics.Color
import android.os.Bundle
import com.github.mikephil.charting.data.PieEntry
import com.loe.ktui.util.KtColor
import com.loe.mvp.BaseActivity
import com.loe.test.R
import kotlinx.android.synthetic.main.activity_test_chart.*
import kotlin.random.Random

class TestChartActivity : BaseActivity()
{
    override fun onCreate(savedInstanceState: Bundle?)
    {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_test_chart)

        val list1 = ArrayList<Pair<String, Int>>()
        for (i in 1..31) list1.add("      $i      " to Random.nextInt(300))
        LineChartManager(lineChart).show(list1)


        val list2 = ArrayList<PieEntry>()
        list2.add(PieEntry(2.3f, "是的是的"))
        list2.add(PieEntry(1.85f))
        list2.add(PieEntry(2.3f, "34ss"))
        list2.add(PieEntry(2.3f, "  h jh"))
        PieChartManager(pieChart).showRing(list2, listOf(KtColor.red, KtColor.main, KtColor.orange, KtColor.gray))


    }
}